package com.honey.service;

import java.util.Properties;

import org.w3c.dom.Element;

import com.honey.configureation.holder.ConfigurationHolder;
import com.honey.configureation.xmlparser.ParseElement;
import com.honey.core.NullPlugin;

public class SampleServicePlugin extends NullPlugin implements ConfigurationHolder{
	private String targetPackage="com.honey.undefine";
	
	private String interfacePackage= targetPackage;
	
	private String interfaceSuffix= "";
	
	private String implementsPackage= interfacePackage+".imp";
	
	private String implementsSuffix= "";
	
	@Override
	public void parserElement(Element element, Properties properties) {
		String tmp = ParseElement.getConfiguration(element, "targetPackage", properties);
		if(tmp != null){
			targetPackage = tmp;
		}
		
		tmp = ParseElement.getConfiguration(element, "interfacePackage", properties);
		if(tmp != null)interfacePackage = tmp;
		
		tmp = ParseElement.getConfiguration(element, "interfaceSuffix", properties);
		if(tmp != null)interfaceSuffix = tmp;
		
		tmp = ParseElement.getConfiguration(element, "implementsPackage", properties);
		if(tmp != null)implementsPackage = tmp;
		
		tmp = ParseElement.getConfiguration(element, "implementsSuffix", properties);
		if(tmp != null)implementsSuffix = tmp;
		
	}

	@Override
	public String toXmlElement() {
		return null;
	}

	@Override
	public void validate() {
	}

	public String getTargetPackage() {
		return targetPackage;
	}

	public String getInterfacePackage() {
		return interfacePackage;
	}

	public String getInterfaceSuffix() {
		return interfaceSuffix;
	}

	public String getImplementsPackage() {
		return implementsPackage;
	}

	public String getImplementsSuffix() {
		return implementsSuffix;
	}
}
